home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_gen / yg600w95.zip / YGREPINT.PAS < prev    next >
Pascal/Delphi Source File  |  1996-12-02  |  9KB  |  212 lines

  1. {******************************************************************}
  2. { Description:                                                     }
  3. {   This is an interface file to the YGREP32.DLL. To use it,       }
  4. {   simply place 'YGrepInt' in the USES clause of your program     }
  5. {   and call the functions as they are defined below. See          }
  6. {   YGrepTst.pas for some sample code.                             }
  7. {                                                                  }
  8. { Author:                                                          }
  9. {   Damien Lewis (louie@melbpc.org.au) - 6th August 1996           }
  10. { Modified:                                                        }
  11. {   96/08/28 - Yves Roumazeilles                                   }
  12. {              Added BLIST definitions                             }
  13. {   96/09/15 - Yves Roumazeilles (5.03)                            }
  14. {              Added YGrepMessages/YGrepOptions and changed       }
  15. {              RGERR_EMPTY_ENCL to RGERR_EMPTY_CL                  }
  16. {   96/11/17 - Yves Roumazeilles (6.00)                            }
  17. {              Added Soundex routines                              }
  18. {******************************************************************}
  19.  
  20. unit YGrepInt;
  21.  
  22. interface
  23.  
  24. const
  25.   { YGrep Search Engine Error Codes }
  26.   AGERR_UNKNOWN_TYPE  = -1;
  27.   AGERR_NO_ERROR      = 0;
  28.   AGERR_STATE         = 1;
  29.   AGERR_ALLOC_MEM     = 2;
  30.   AGERR_TOO_SHORT     = 3;
  31.   AGERR_TOO_LONG      = 4;
  32.   AGERR_NO_PREVIOUS   = 5;
  33.   AGERR_NO_PATTERN    = 6;
  34.   RGERR_MUNGED_AUTO   = 20;
  35.   RGERR_MISS_BRACKET  = 25;
  36.   RGERR_EMPTY_CL      = 26;
  37.   RGERR_ILLEGAL_CL    = 27;
  38.   RGERR_TOO_MANY_PAR  = 28;
  39.   RGERR_NULL_IN_PAR   = 29;
  40.   RGERR_UNMATCHED     = 30;
  41.   RGERR_NULL_IN_CRO   = 31;
  42.   RGERR_CYCLICAL_REF  = 32;
  43.   RGERR_UNDETERM_REF  = 33;
  44.   RGERR_UNMATCHED_PAR = 34;
  45.  
  46.   { YGrep Search Engine Error Codes }
  47.   YO_EOLCR    = 1;
  48.   YO_EOLLF    = 2;
  49.   YO_EOLCRLF  = 3;
  50.   YO_ERRMSG   = 8;
  51.  
  52.  
  53.   { Misc Constants }
  54.   MATCH       = 0;
  55.   MISMATCH    = 1;
  56.   EXACTMATCH  = 2;
  57.   MAXSYM      = 256;
  58.   WORD_SIZE   = 512;
  59.   MAXTAG      = 10;
  60.   MAXDFA      = 2 * WORD_SIZE + 32;
  61.  
  62. type
  63.   { AGrep Structure }
  64.     PtagAGrepInfo = ^tagAGrepInfo;
  65.     tagAGrepInfo = record
  66.     iErrorCode: Integer;
  67.     cPat: array[0..WORD_SIZE - 1] of char;
  68.     TagStart: array[0..MAXTAG - 1] of PChar;
  69.     TagEnd: array[0..MAXTAG - 1] of PChar;
  70.     bMatchCase: Integer;
  71.     bMessages: Integer;
  72.     uMask: array[0..19] of char;
  73.     uOvMask: array[0..19] of char;
  74.     uLimit: array[0..19] of char;
  75.     blState: array[0..19] of char;
  76.     blOverflow: array[0..19] of char;
  77.     blTemp: array[0..19] of char;
  78.     uTable: array[0..MAXSYM - 1] of array[0..19] of char;
  79.     iBitsPerState: Integer;
  80.     iWordSize: Integer;
  81.     iType: Integer;
  82.     cUPat: array[0..WORD_SIZE - 1] of char;
  83.   end;
  84.  
  85.   { RGrep Structure }
  86.     PtagRGrepInfo = ^tagRGrepInfo;
  87.     tagRGrepInfo = record
  88.     iErrorCode: Integer;
  89.     cPat: array[0..WORD_SIZE - 1] of char;
  90.     TagStart: array[0..MAXTAG - 1] of PChar;
  91.     TagEnd: array[0..MAXTAG - 1] of PChar;
  92.     bMatchCase: Integer;
  93.     bMessages: Integer;
  94.     iCircf: Integer;
  95.     cDFA: array[0..MAXDFA - 1] of char;
  96.   end;
  97.  
  98.   { SGrep Structure }
  99.     PtagSGrepInfo = ^tagSGrepInfo;
  100.     tagSGrepInfo = record
  101.     iErrorCode: Integer;
  102.     cPat: array[0..WORD_SIZE - 1] of char;
  103.     TagStart: array[0..MAXTAG - 1] of PChar;
  104.     TagEnd: array[0..MAXTAG - 1] of PChar;
  105.     bMatchCase: Integer;
  106.     bMessages: Integer;
  107.     cDFA: array[0..MAXDFA - 1] of char;
  108.   end;
  109.  
  110. { Misc Function Declarations }
  111. function YGrepVersion: Word; stdcall;
  112.  
  113. { AGrep Function Declarations }
  114. function CompileAGrep(GrepString: PChar; k: Integer; MatchCase: Integer; pGI: PtagAGrepInfo): Integer; stdcall;
  115. function AGrep(StringToSearch: PChar; pGI: PtagAGrepInfo): Integer; stdcall;
  116. function AGrepInit(pGI: PtagAGrepInfo): Integer; stdcall;
  117. function AGrepEmpty(pGI: PtagAGrepInfo): Integer; stdcall;
  118. function AGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI: PtagAGrepInfo): Integer; stdcall;
  119. function AGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI: PtagAGrepInfo): Integer; stdcall;
  120. function SCompileAGrep(GrepString: PChar; k: Integer; bMatchCase: Integer): Integer; stdcall;
  121. function SAGrep(StringToSearch: PChar): Integer; stdcall;
  122. procedure SAGrepInit; stdcall;
  123. procedure SAGrepEmpty; stdcall;
  124. function SAGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  125. function SAGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  126.  
  127. { RGrep Function Declarations }
  128. function CompileRGrep(GrepString: PChar; MatchCase: Integer; pGI: PtagRGrepInfo): Integer; stdcall;
  129. function RGrep(StringToSearch: PChar; pGI: PtagRGrepInfo): Integer; stdcall;
  130. function RGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI:PtagRGrepInfo): Integer; stdcall;
  131. function RGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI: PtagRGrepInfo): Integer; stdcall;
  132. procedure InitWordCharTable; stdcall;
  133. procedure AddWordCharTable(s: PChar); stdcall;
  134. procedure RemoveWordCharTable(s: PChar); stdcall;
  135. function SCompileRGrep(GrepString: PChar; MatchCase: Integer): Integer; stdcall;
  136. function SRGrep(StringToSearch: PChar): Integer; stdcall;
  137. function SRGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  138. function SRGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  139.  
  140. { SGrep Function Declarations }
  141. function CompileSGrep(GrepString: PChar; MatchCase: Integer; pGI: PtagSGrepInfo): Integer; stdcall;
  142. function SGrep(StringToSearch: PChar; pGI: PtagSGrepInfo): Integer; stdcall;
  143. function SGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI:PtagSGrepInfo): Integer; stdcall;
  144. function SGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer; pGI: PtagSGrepInfo): Integer; stdcall;
  145. function SCompileSGrep(GrepString: PChar; MatchCase: Integer): Integer; stdcall;
  146. function SSGrep(StringToSearch: PChar): Integer; stdcall;
  147. function SSGrepSubsBuild(lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  148. function SSGrepSubstitute(SearchedString: PChar; lpszPattern: PChar; lpszDest: PChar; iSize:Integer): Integer; stdcall;
  149.  
  150. { SFile Function Declarations }
  151. procedure SFileSetFlags(bPrintFileName, bPrintBlockNumber, bPrintLineNumber, bCountsOnly, bNonMatching: Integer); stdcall;
  152. function SFileOpen(strFileName: PChar): Integer; stdcall;
  153. function SFileAGrep: PChar; stdcall;
  154. function SFileRGrep: PChar; stdcall;
  155. function SFileSGrep: PChar; stdcall;
  156. function SFileClose: LongInt; stdcall;
  157.  
  158.  
  159. implementation
  160.  
  161. { Misc Functions }
  162. function YGrepVersion; external 'YGREP32.DLL';
  163. function YGrepMessages; external 'YGREP32.DLL';
  164. function YGrepOptions; external 'YGREP32.DLL';
  165.  
  166. { AGrep Functions }
  167. function CompileAGrep; external 'YGREP32.DLL';
  168. function AGrep; external 'YGREP32.DLL';
  169. function AGrepInit; external 'YGREP32.DLL';
  170. function AGrepEmpty; external 'YGREP32.DLL';
  171. function AGrepSubsBuild; external 'YGREP32.DLL';
  172. function AGrepSubstitute; external 'YGREP32.DLL';
  173. function SCompileAGrep; external 'YGREP32.DLL';
  174. function SAGrep; external 'YGREP32.DLL';
  175. procedure SAGrepInit; external 'YGREP32.DLL';
  176. procedure SAGrepEmpty; external 'YGREP32.DLL';
  177. function SAGrepSubsBuild; external 'YGREP32.DLL';
  178. function SAGrepSubstitute; external 'YGREP32.DLL';
  179.  
  180. { RGrep Functions }
  181. function CompileRGrep; external 'YGREP32.DLL';
  182. function RGrep; external 'YGREP32.DLL';
  183. function RGrepSubsBuild; external 'YGREP32.DLL';
  184. function RGrepSubstitute; external 'YGREP32.DLL';
  185. procedure InitWordCharTable; external 'YGREP32.DLL';
  186. procedure AddWordCharTable; external 'YGREP32.DLL';
  187. procedure RemoveWordCharTable; external 'YGREP32.DLL';
  188. function SCompileRGrep; external 'YGREP32.DLL';
  189. function SRGrep; external 'YGREP32.DLL';
  190. function SRGrepSubsBuild; external 'YGREP32.DLL';
  191. function SRGrepSubstitute; external 'YGREP32.DLL';
  192.  
  193. { SGrep Functions }
  194. function CompileSGrep; external 'YGREP32.DLL';
  195. function SGrep; external 'YGREP32.DLL';
  196. function SGrepSubsBuild; external 'YGREP32.DLL';
  197. function SGrepSubstitute; external 'YGREP32.DLL';
  198. function SCompileSGrep; external 'YGREP32.DLL';
  199. function SSGrep; external 'YGREP32.DLL';
  200. function SSGrepSubsBuild; external 'YGREP32.DLL';
  201. function SSGrepSubstitute; external 'YGREP32.DLL';
  202.  
  203. { SFile Function Declarations }
  204. procedure SFileSetFlags; external 'YGREP32.DLL';
  205. function SFileOpen; external 'YGREP32.DLL';
  206. function SFileAGrep; external 'YGREP32.DLL';
  207. function SFileRGrep; external 'YGREP32.DLL';
  208. function SFileSGrep; external 'YGREP32.DLL';
  209. function SFileClose; external 'YGREP32.DLL';
  210.  
  211. end.
  212.